<?php
/**
 * Project: firework-cms             >>  http://firework-cms.googlecode.com
 * Authors: YouniS Ben Salah  (-.-)  >>  http://younishd.kegtux.org
 *          Fabien Wang       (^.^)  >>  http://fabienwang.fr
 * License: See README and LICENSE in the top level directory
 */
/**
 * Snippet: blog ( generic )
 * Required data:
 *      + main_heading
 *      + posts ( PDOStatement object )
 *          + posts::postid
 *          + posts::title
 *          + posts::creation_date
 *          + posts::content
 *      + action_param
 */
echo '<section id="posts">';
if ( isset($this->data['main_heading']) ) { echo $this->data['main_heading']; }
if ( isset($this->data['posts']) ) {
    while ( $entry = $this->data['posts']->fetch() ) {
        echo '<article>';
        echo '<h3><a href="?do=post&amp;id=' . $entry['postid'] . '">' . $entry['title'] . '</a></h3>';
        echo '<section>' . $entry['creation_date'] . '<br /></section>';
        echo $entry['content'];
        echo '</article>';
    }
}
echo '</section>';
